// page/member/issue.js
//获取应用实例  
var app = getApp()
Page({
  data: {
    /** 
        * 页面配置 
        */
    winWidth: 0,
    winHeight: 0,
    // tab切换  
    currentTab: 0,
    dates: '2016-11-08',
    date: '2016-11-08',
    index: 0,
    classId:1
  },
  onLoad: function () {
    var that = this
    that.setData({
      isHide: true,
      // options: options
    })
    /** 
     * 获取系统信息 
     */
    wx.getSystemInfo({

      success: function (res) {
        that.setData({
          winWidth: res.windowWidth,
          winHeight: res.windowHeight
        });
      }

    });
  },
  /** 
     * 滑动切换tab 
     */
  bindChange: function (e) {
    var that = this;
    that.setData({ currentTab: e.detail.current });
  },
  /** 
   * 点击tab切换 
   */
  swichNav: function (e) {
    var that = this;
    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current,
        classId: e.target.dataset.classid,
      })
      this.getlist();
    }
  },
  onShow: function () {
    this.getlist();
  },
   getlist: function () {
    var app = getApp()
    var that = this;
    var uid = wx.getStorageSync('uid');
    wx.request({
      url: app.globalData.host + '&g=App&m=User&a=normal',
      data: {
        // id: that.data.options.id,
        uid: uid,
        classId: that.data.classId
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)
        that.setData({
          list: res.data.list,
        })
      }
    })
  },
}) 